float ambient;
float4 ambientColor;
float lightAmbient;

Texture ColorMap;
sampler ColorMapSampler = sampler_state
{
	texture = <ColorMap>;
	magfilter = Linear;
	minfilter = Linear;
	mipfilter = Linear;
	AddressU = Mirror;
	AddressV = Mirror;
};

Texture ShadowMap;
sampler ShadowMapSampler = sampler_state
{
	texture = <ShadowMap>;
	magfilter = Linear;
	minfilter = Linear;
	mipfilter = Linear;
	AddressU = Mirror;
	AddressV = Mirror;
};

float4 CombinedPixelShader(float4 inColor : COLOR0, float2 inTexCoords : TEXCOORD0) : COLOR0
{
    float4 color2 = tex2D(ColorMapSampler, inTexCoords);
    float4 shading = tex2D(ShadowMapSampler, inTexCoords);
    
    float4 finalColor = (color2 * ambientColor * ambient);
    
    finalColor += color2 * shading * lightAmbient;
    
    return finalColor;
}

technique LightingCombined
{
    pass Pass1
    {
        PixelShader = compile ps_2_0 CombinedPixelShader();
    }
}
